Migrate Your Database
If you are an existing Crypto Command Center user who wants to upgrade to Crypto Command Center 4.0, while being able to migrate the existing databse to Crypto Command Center 4.0, you need to adopt one of the following scenarios.
Migrate your PostgreSQL database
Follow one of the following procedures to migrate your existing PostgreSQL datbase to CCC 4.0, depending on your requirements:
Migrate to internal PostgreSQL database
The steps involved in migrating your existing PostgreSQL database to a new internal PostgreSQL database for CCC 4.0 are:
Install CCC 4.0 using Podman, as explained here.
Login to the virtual machine that contains your existing PostgreSQL database.
Create a dump of your existing database using the following command:
pg_dump -h IP of source PostgreSQL database -p 5432 -U lunadirector lunadirectordb > postgres.sql
Copy the dump that you’ve created to the podman directory inside the CCC package.
Go the the podman directory inside the CCC package and run the following command to copy the postgres.sql file inside the CCC container:
podman cp postgres.sql ccc:/usr/safenet/ccc/
Run the following command to start data migration to internal PostgreSQL database.
podman exec ccc bash -c "cd scripts && sh dbmig.sh 'CCC_ADMIN_PASSWORD'"
If you are using special characters such as # and $ in the password, you need to put a backward slash \ before those characters to avoid errors.
Upon successful completion of the data migration process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate to external PostgreSQL database
The steps involved in migrating your existing PostgreSQL database to a new external PostgreSQL database for CCC 4.0 are:
Use the link that you would have received over email to download and extract the CCC package.
Login to the virtual machine that contains your existing PostgreSQL database.
Create a dump of your existing database by running the following command:
pg_dump -h IP of source PostgreSQL database -p 5432 -U lunadirector lunadirectordb > postgres.sql
Start your target PostgreSQL database where you want to migrate your existing database.
Open the directory where you’ve created the postgres.sql file in step 3 and run the following command to copy the existing database to the target database:
psql -h IP of target postgres db -p 5432 -U lunadirector -f postgres.sql lunadirectordb
Install CCC 4.0 using either Podman or Kubernetes, as explained here.
During CCC 4.0 installation, while modifying the configuration settings in the Master node, you need to provide various database related details, such as IP of the target database and database password.
Upon successful completion of the CCC installation process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate your Oracle database
Follow the below-mentioned three-step process to migrate your data from Oracle to PostgreSQL:
Install CCC 4.0
Before you begin the process of migrating your database from Oracle to PostgreSQL, install CCC 4.0, using the steps explained here.
Migrate database
Follow steps 1 to 9, if you've installed CCC using Podman and are using an internal database. Follow steps 1 to 12 if you've installed CCC using Podman and are using an external database. Follow steps 1 to 14 if you've installed CCC using Kubernetes and are using an external database.
Download the db-migration package, depending on whether you are using an external database or an internal database.
Go to the directory where you’ve downloaded the db-migration package.
Run one of the following commands to initiate the process of database migration from Oracle to PostgreSQL, depending on whether are using an external database or an internal database:
sh start-data-migration-external-db.sh
or,
sh start-data-migration-internal-db.sh
Enter Y to initiate the database migration process.
Enter the hostname or IP address, enter oracle as the user name, and enter the password of the Oracle database server.
Enter the Oracle database server password to begin the initial setup.
Enter the Oracle database server password to begin data extraction.
Enter the Oracle database server password to copy the files from Oracle database server to your local machine.
Enter the Oracle database server password to delete the data-dump files. Following this, database insertion will take place, CCC will get reconfigured, and the server will get restarted. This process can take some time to get completed, depending on the size of your database.
If you've installed CCC using Podman and are using an internal database, your database migration process gets completed with this step and you can now activate CCC after database migration. If you've installed CCC using Podman and are using an external database, or have installed CCC using Kubernetes and are using an external database, continue to the next step.
Copy the files from the local machine to PostgreSQL server or virtual machine by entering the PostgreSQL database server hostname or IP address, user name (root user), and password.
Enter the PostgreSQL database server password once again to insert data into Keycloak and Lunadirector schemas.
Enter the PostgreSQL database server password once again to run the re-configuration script and start CCC.
If you've installed CCC using Podman and are using an external database, your database migration process gets completed with this step and you can now activate CCC after database migration. If you've installed CCC using Kubernetes and are using an external database, you need to follow the following additional steps.
Navigate to the ccc/kubernetes directory and delete the existing CCC container using the following command:
kubectl delete –f deployment.yaml
Restart Kubernetes container using the following command:
kubectl apply –f deployment.yaml
This completes the database migration process if you've installed CCC using Kubernetes and are using an external database. You can now activate CCC after database migration.
Activate CCC after database migration
Log on to CCC.
Click the Administration tab from the main menu and complete the CCC activation process as follows:
-
Check the checkbox to confirm that your HSM device is running firmware 7.7 or above.
-
Enter the partition label and password.
-
Press the Activation button. You will see a message stating that CCC has been successfully activated.
Upload your CCC license and press Continue. This completes the database migration process.
You should check whether all of your data has been successfully migrated from Oracle to PostgreSQL. It is recommended that you retain your Oracle database for some time after completing the migration process.
Reconfiguring devices after changing the CCC root of trust
In case you've changed the CCC root of trust (ROT), you need to reconfigure the devices to perform device monitoring and various other device management tasks. To reconfigure your devices:
Login to CCC and navigate to Devices.
Select the device that is displaying the error under the Device Status column.
Click the Connection tab.
Press the Update Credentials button.
In the Update Rest API Credentials window that appears, enter your username and password and then press the Update button. A pop-up message will appear on your screen, indicating that the credentials have been successfully changed.
Click the Authorization tab and then press the Re-authorize Device button.
In the Authorize SO Login window that appears, enter the HSM SO password to grant CCC the right to login to the device, and then press the Authorize button.
In a short while, the Device Status icon will turn to green and you'll be able to perform the device monitoring tasks. In case you have another device that's reflecting the same error perform the above-mentioned procedure again for that device.